import { defineStore } from 'pinia'
import { reqSearchHospitalsByName } from '@/service/modules/home'
import type { IHomeHospitalCardListArr } from '@/service/modules/home/type'
interface IState {
  searchHospital: IHomeHospitalCardListArr
}
export const useSearchBoxStore = defineStore('search', {
  state: (): IState => {
    return {
      searchHospital: []
    }
  },
  actions: {
    async fecthSearchHospitalByNameAction(hosname: string) {
      const res = await reqSearchHospitalsByName(hosname)
      if (res?.code == 200) {
        this.searchHospital = res.data
      }
    }
  }
})
